/* 基础样式 */
body {
    background-color: #F5F7FA;
    font-family: sans-serif;
    color: #333333;
    height: 100%;
    width: 100%;
    position: relative;
    margin: 0;
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #FFFFFF;
    color: #2E7D32;
    padding: 16px 0 16px 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
    padding-right: 8px;
}

.nav-button {
    color: #2E7D32;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 500;
}

.nav-spacer {
    width: 24px;
}

/* 聊天内容区域 */
.chat-container {
    width: 100%;
    padding-top: 64px;
    padding-bottom: 80px;
    padding-left: 0;
    padding-right: 0;
    overflow-y: auto;
}

/* 聊天气泡 */
.chat-bubble {
    max-width: 80%;
    word-wrap: break-word;
}

.message-container {
    display: flex;
    margin-bottom: 16px;
    padding-left: 8px;
    padding-right: 8px;
}

.message-container.user {
    justify-content: flex-end;
}

.assistant-message {
    background-color: #E8F5E9;
    padding: 12px;
    border-radius: 12px;
    border-top-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message {
    background-color: #2E7D32;
    color: white !important;
    padding: 12px;
    border-radius: 12px;
    border-top-right-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message p {
    color: #FAFAFA;
}

/* 头像样式 */
.message-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.assistant-avatar {
    background-color: #4CAF50;
    border-radius: 50%;
    color: white;
    margin-right: 8px;
}

.user-avatar {
    background-color: #CCCCCC;
    border-radius: 50%;
    color: #666666;
    margin-left: 8px;
}

.avatar-icon {
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 消息时间 */
.message-time {
    font-size: 12px;
    margin-top: 4px;
    text-align: right;
}

.assistant-time {
    color: #777777;
}

.user-time {
    color: #E0E0E0;
}

/* 输入区域 */
.input-area {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #F1F8E9;
    padding: 12px 0 12px 0;
    border-top: 1px solid #E8F5E9;
}

.input-container {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding-left: 8px;
    padding-right: 8px;
}

/* 图片功能按钮样式 */
.image-actions {
    display: flex;
    gap: 8px;
    margin-right: 8px;
}

.image-button {
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.image-button:hover {
    background-color: #F5F5F5;
    border-color: #2E7D32;
}

.image-button:active {
    background-color: #E8F5E9;
    transform: scale(0.95);
}

.input-field {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 8px 16px;
    margin-right: 0;
}

.input-field input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.send-button {
    background-color: #2E7D32;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 20px 20px;
    cursor: pointer;
    margin-left: 8px;
}

/* 打字指示器 */
.typing-indicator {
    display: inline-block;
}

.mt-2 {
    margin-top: 8px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 4px;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.stop-button {
    background-color: rgb(239 68 68);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 20px 20px;
    cursor: pointer;
    margin-left: 8px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E0E0E0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #F5F5F5;
}

.modal-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #E0E0E0;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2E7D32;
    color: white;
}

.btn-primary:hover {
    background-color: #1B5E20;
}

.btn-secondary {
    background-color: #F5F5F5;
    color: #666;
    border: 1px solid #E0E0E0;
}

.btn-secondary:hover {
    background-color: #E0E0E0;
}

/* 图片消息样式 */
.user-message img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.user-message img:hover {
    transform: scale(1.02);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .image-actions {
        gap: 4px;
        margin-right: 4px;
    }
    
    .image-button {
        min-width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
}